local uid=KEYS[1];
local pid=KEYS[2];
local stockKey="kill_sk::"..pid;
local userKey="kill_uk::"..pid;
local stockExist=redis.call('EXISTS',stockKey);
if stockExist==0 then
    return 1;
end;
local userExist=redis.call('SISMEMBER',userKey,uid);
if(userExist==1) then
    return 3;
end;
local stockNum=tonumber(redis.call('GET',stockKey));
if(stockNum<=0) then
    return 2;
else
    redis.call('DECR',stockKey);
    redis.call('SADD',userKey,uid);
    return 4;
end;

